package com.xiaolin.redissiondemo.controller;

import com.xiaolin.redissiondemo.service.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xiaolin
 * @description 仓库服务
 * @since 2024/5/23
 */
@RestController
@RequestMapping("/storage")
public class StorageController {
    @Autowired
    private StorageService storageService;

    @GetMapping("/reduceStorage/{productId}")
    public String reduceStorage(@PathVariable Integer productId) {
        return storageService.reduceStorage(productId);
    }
}
